home *** CD-ROM | disk | FTP | other *** search
/ Aminet 3 / Aminet 3 - July 1994.iso / Aminet / demo / mag / bitmap001.lha / EngineFlair.article (.txt) < prev    next >
Encoding:
Magnetic Pages Article  |  1993-11-12  |  5.9 KB  |  38 lines

  1. MPARTICLE
  2. qJ--------------------------------------------------------------------------A      >----- Interesting Lighting Effects With POV-Ray 2.0 -----<=          By Rowan Crawford : s1171180@giaeb.cc.monash.edu.auJ--------------------------------------------------------------------------
  3. G    My recent efforts with POV has been the creation of an X-Wing modelHfor use in some animations. My aim was to get it as close as possible toHthe "real" thing using as few texture maps as possible. This was becauseHI wished to do some decent sized animations, and textures would increase&the rendering time quite dramatically.F    Anyway, I came across one "feature" which I wished to include, butHfound no easy way (through the POV commands) to easily recreate it. WhatFfollows is the result of a combination of ideas and experimentation by>myself, Brian Switzer (bswitzer@uoguelph.ca) and Luis R. Anaya
  4. (papo@gamekeeper.bellcore.com).
  5. G    The effect that I was after was that "haze" effect that is producedCaround the engines. I call it "engine flair", but it's basically a Ftransparent haze of red fog produced (I think) by the engines pointingEat the camera lens (you can only see it when you can see the white of.the engine). Kind of like lense flair I guess.G    This effect is somewhat similar to a spot light beaming through fogCso I imagine with a few modifications, the following could also get;produce that effect also. Just a matter of experimentation.
  6. THE BASIC IDEAE    The basic ingredients used are a sphere, a gradient color_map andHthe filter command (was "alpha" pre-POV v2.0). The sphere is created andDthen mapped with a red gradient color_map which has a fair amount ofFtransparency. This combination does indeed produced a "similar" effectFto what I am after, but is still different. It's still the best result
  7. I've seen.
  8. K    The color_map itself is the important part of the combo. Unfortunately,Fthe way that the filter command works with POV means that the requiredBeffect cannot be achieved as easily as I would like, but with some"fiddling, the following was found:
  9.  pigment {
  10.   gradient z
  11.   color_map {5   [ 0.00 color red 1 green 0.2 blue 0.2 filter 0.4 ]5   [ 0.10 color red 1 green 0.5 blue 0.5 filter 0.5 ]5   [ 0.33 color red 1 green 0.9 blue 0.9 filter 0.8 ]5   [ 0.45 color red 1 green 1.0 blue 1.0 filter 1.0 ]5   [ 1.00 color red 1 green 1.0 blue 1.0 filter 1.0 ]
  12.   translate <0,0,2>
  13. KBasically, what it does is to begin with a bright, and slightly transparentLred which fades quickly into a slightly whiter red. This then changes slowlyIto a "near white" red with much transparency then, finally, into nothing.JYou'll notice that between 0.45 and 1.00 it is all completely clear - thisIis simply to make the flair more of a dish rather than half a sphere - itGjust depends on what effect you want as to how soon you fade completely
  14. out.I    All this is then mapped onto a sphere which is cut in two. Here's the
  15. basic object with translations:
  16. .    object {                  // Engine flair.
  17.   difference {
  18.    sphere { <0,0,0>,1 }
  19.    sphere { <0,0,0>,0.99 }
  20.         no_shadow         pigment { goes in here }
  21.   finish { goes in here }&        translations { go about here }%  clipped_by { plane { <0,0,-1>,0 } }
  22. GThere we have a unit sphere (hollowed out with an optional "difference"Fsphere) onto which is placed our above color_map. You'll notice in theGcolor_map that I've translated the map forward by <0,0,2> -  this is toEslide the map into a better position. Finally, we simply clip off theKsecond half of the sphere (which has a mirror of the first set of colours).
  23. K    As an extra touch, I also included a little bit of "crand" (randomness)Hinto the texture to mess it up a bit. Since crand is -really- random, itHis different with each render, but since that is exactly the effect thatGthe engine flair produces, I can use it. I wouldn't use crand for a fog
  24. effect thought.I    There is a small problem with crand and that is that we must use veryGlow values (0.01 and less) because of the way that it works - otherwiseIis makes it really dark. Actually, crand is not ideal for this situation,/but was the best command that I found to do it.H    While I'm mentioning problems, I'll get onto the filter command. TheGway it works is to base the transparency on how close to white a colourIis. That means, to have something completely (or very nearly) transparentH(as we need for the outer limits of the flair), then the pigment must be(close to white ( red 1 green 1 blue 1 ).H    This means that you cannot have dark colours, transparent which is aHpitty. I originally wanted to have the outer most limits of the flair toJbe bright red ( red 1 green 0 blue 0 ) but although the colour looks good,Kit was not transparent. This means that I had to fade to white at the edge.
  25. THATS ALL FOLKSH    Well, thats about it. By no means does it produce exactly the effectDthat I was after, but the result is similar. The thing is, that thisHtechnique would lend itself well to a variety of different effects so it
  26. may be of some use.
  27. K    For anyone interested, the effect that I was really trying to reproduce9can be seen on a picture found on the following FTP site:
  28. 3    wpi.wpi.edu     /starwars/Pictures/x-wing01.gif
  29. IBut it's only there every now and again because they rotate the pics. I'dKcertainly be keen to here from anyone who comes up with a better solution!!
  30. See ya,
  31.             Rowan Crawford.
  32. POV-Ray 2.0: Page 1 of 6
  33. POV-Ray 2.0: Page 2 of 6
  34. POV-Ray 2.0: Page 3 of 6
  35. POV-Ray 2.0: Page 4 of 6
  36. POV-Ray 2.0: Page 5 of 6
  37. POV-Ray 2.0: Page 6 of 6
  38.